//
// Created by alexa on 5/13/2024.
//

#ifndef ARTILLERYSYSTEM_BATTALIONREPOSITORY_H
#define ARTILLERYSYSTEM_BATTALIONREPOSITORY_H


#include "../../entities/battalion/Battalion.h"
#include "../../entities/_identifiable/IdentifiableList.h"

class BattalionRepository {
private:
    IdentifiableList<Battalion> source;

    string fileSourcePath;
public:
    const string &getFileSourcePath() const;

    virtual ~BattalionRepository();

    void setFileSourcePath(const string &fileSourcePath);

    void loadDataFromFile();

    void saveDataToFile();

    explicit BattalionRepository(const string &fileSourcePath = "battalions.json");

    Battalion *findById(string id);

    void save(Battalion *battalion);

    void deleteOne(Battalion *battalion);

    vector<Battalion *> findAll();
};


#endif //ARTILLERYSYSTEM_BATTALIONREPOSITORY_H
